using System;
using System.Runtime.InteropServices;

namespace BarcodePrinting.BTP
{
	public static class BtpDll
	{
		public const int BPLA_OK = 1000;

		public const int BPLA_COMERROR = 1001;

		public const int BPLA_PARAERROR = 1002;

		public const int BPLA_FILEOPENERROR = 1003;

		public const int BPLA_FILEREADERROR = 1004;

		public const int BPLA_FILEWRITEERROR = 1005;

		public const int BPLA_FILEERROR = 1006;

		public const int BPLA_NUMBEROVER = 1007;

		public const int BPLA_IMAGETYPEERROR = 1008;

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_OpenCom(string sComName, int nBaudrate, int nHandshake);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_OpenComEx(string sComName, int nBaudrate, int nHandshake, int nWriteTimeOut);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_CloseCom();

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_OpenLpt(int nAddress, int nBusySleep);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_CloseLpt();

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_OpenUsb();

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_CloseUsb();

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_SetTimeOut(int nWriteTimeOut);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_OpenPrinterDriver(string sDriverName);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_ClosePrinterDriver();

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_StartDoc();

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_EndDoc();

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_SetSensor(int nLabelMode);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_SetSaveFile(bool bSave, string sFilename, bool bPort);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_SetPaperLength(int nPaperLength, int nLength);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_StartArea(int nUnitmode, int nPrintwidth, int nColumn, int nRow, int nDarkness, int nSpeedprint, int nSpeedfor, int nSpeedbac);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_SetAllRotate(int nRotatemode);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_Print(int nPieces, int nSamepieces, int nOutunit);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintLine(int startx, int starty, int endx, int endy, int linewidth);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintText(string text, int startx, int starty, int rotate, int fonttype, int pointwidth, int pointheight, string addvalue, int space, int bitmode);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintOut(string text, int startx, int starty, int rotate, string fonttype, int pointwidth, int pointheight, string addvalue, int space, int bitmode);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintMixText(string text, int startx, int en_starty, int cn_starty, int rotate, int en_fonttype, string cn_fonttype, int en_width, int cn_width, int pointwidth, int pointheight, string addvalue, int space, int bitmode);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintMixTextEx(string text, int startx, int en_starty, int xy_adjust, int rotate, string en_fonttype, string cn_fonttype, int pointwidth, int pointheight, string addvalue, int space, int bitmode);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintTruetype(string sText, int nStartX, int nStartY, string sFontname, int nFontheight, int nFontwidth);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintTruetypeEx(string sText, int nStartX, int nStartY, string sFontname, int nFontheight, int nFontwidth, int nRowotate);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintImage(string filename, int startx, int starty, int bitmode);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintBarcode(string sCodedata, int nStartX, int nStartY, int nRotate, int nBartype, int nHeight, int nNumber, int nNumberbase, string sAddvalue);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_PrintPDF(string codedata, int startx, int starty, int rotate, int basewidth, int baseheight, int scalewidth, int scaleheight, int row, int column, int cutmode, int level, int length, string addvalue);

		[DllImport("BPLADLL.dll")]
		public static extern int BPLA_CheckStatus(byte[] aPapershort, byte[] aRibbionshort, byte[] aBusy, byte[] aPause, byte[] aCom, byte[] aHeadheat, byte[] aHeadover, byte[] aCut);
	}
}
